package com.guyu.plugin.oss.enums;

import com.guyu.common.core.enums.able.IEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import software.amazon.awssdk.services.s3.model.ObjectCannedACL;

/**
 * 桶访问策略配置
 */
@Getter
@AllArgsConstructor
public enum ObjectAccessPolicyType implements IEnum<ObjectAccessPolicyType> {

    DEFAULT(0, "继承Bucket", null),

    PRIVATE(1, "私有", ObjectCannedACL.PRIVATE),

    PUBLIC_READ(2, "公共读", ObjectCannedACL.PUBLIC_READ),

    PUBLIC(3, "公共读写", ObjectCannedACL.PUBLIC_READ_WRITE);


    /**
     * 权限类型
     */
    private final Integer code;
    private final String desc;
    /**
     * 文件对象 权限类型
     */
    private final ObjectCannedACL objectCannedACL;


    @Override
    public ObjectAccessPolicyType getDefault() {
        return DEFAULT;
    }
}
